import React, { Component } from 'react';
import style from '../css/common_header.module.css';
import { Breadcrumb } from 'antd';
import MyNavLink from '../../components/mynavlink';
class CommonHeader extends Component {
  constructor(props) {
    super(props);
    this.state = {  }
  }

  goback=()=>{
    this.props.goback()
  }

  render() { 
    return (
      <div className={style.header}>
        <Breadcrumb>
          {
            this.props.bread.map((e,index)=>(<Breadcrumb.Item key={index}>{e.p_bread?(e.name):(e.ifback?<span className={style.goback} onClick={this.goback}>{e.name}</span>:<MyNavLink to={e.url}>{e.name}</MyNavLink>)}</Breadcrumb.Item>))
          }
        </Breadcrumb>
          <span className={style.name}>{this.props.title_name}</span>
      </div>
    );
  }
}
 
export default CommonHeader;